import * as THREE from 'three'
import Experience from './Experience';
import { EventEmitter } from 'events'
export default class Sizes extends EventEmitter {
    constructor() {
        super();
        this.experience = new Experience()
        this.outBox = this.experience.outBox;
        this.width = this.outBox.clientWidth;
        this.height = this.outBox.clientHeight;
        this.aspect = this.width / this.height;
        this.pixelRatio = Math.min(window.devicePixelRatio, 2);

        window.addEventListener('resize', () => {
            this.width = this.outBox.clientWidth;
            this.height = this.outBox.clientHeight;
            this.aspect = this.width / this.height;
            this.pixelRatio = Math.min(window.devicePixelRatio, 2);
            this.emit("resize");
        })
    }
}